package com.chinasofti.polymorphic;

public class Testpy {
    public static void main(String[] args) {
        cat c = new cat();
        Animal a = new cat();
        a.eat();
    }
}

class Animal{
    public void eat(){
        System.out.println("吃饭");
    }
}

class cat extends Animal{
    public void eat() {
        System.out.println("吃鱼");
    }
}